data->name, data->visible ? "yes" : "NO", data->objid));
data->data = wpt = waypt_new();
+#if NEW_STRINGS
+ wpt->shortname = QString::fromLatin1(data->name);
+#else
wpt->shortname = xstrdup(data->name);
+#endif
time = data->mtime;
if (! time) {
}
if (*cend++) {
+#if NEW_STRINGS
+ wpt->notes = QString::fromLatin1(cend);
+#else
wpt->notes = xstrdup(cend);
+#endif
}
if (wpt->HasUrlLink()) {
DBG((sobj, "url = \"%s\"\n", wpt->url));
}
} else if (*str) {
+#if NEW_STRINGS
+ wpt->notes = QString::fromLatin1(str);
+#else
wpt->notes = xstrdup(str);
+#endif
}
xfree(str);
-
+#if NEW_STRINGS
+ if (!wpt->notes.isEmpty()) {
+#else
if (wpt->notes) {
+#endif
DBG((sobj, "notes = \"%s\"\n", wpt->notes));
}
wpt->latitude = wpt2->latitude;
wpt->longitude = wpt2->longitude;
-
+#if NEW_STRINGS
+ wpt->shortname = (wpt2->shortname);
+#else
xfree(wpt->shortname);
wpt->shortname = xstrdup(wpt2->shortname);
+#endif
+#if NEW_STRINGS
+ wpt->description = (wpt2->description);
+ wpt->notes = (wpt2->notes);
+#else
if (wpt2->description) {
wpt->description = xstrdup(wpt2->description);
}
if (wpt2->notes) {
wpt->notes = xstrdup(wpt2->notes);
}
+#endif
if (wpt2->HasUrlLink()) {
UrlLink l = wpt2->GetUrlLink();
wpt->notes = xstrdup(l.url_.toUtf8().data());
static void
mmo_write_wpt_cb(const waypoint* wpt)
{
- char* str, *cx;
+ char* str;
+ String cx;
int objid;
time_t time;
int icon = 0;
}
DBG(("write", "waypoint \"%s\"\n", wpt->shortname ? wpt->shortname : "Mark"));
-
+#if NEW_STRINGS
+ objid = mmo_write_obj_head("CObjWaypoint",
+ wpt->shortname.isEmpty() ? "Mark" : CSTRc(wpt->shortname), time, obj_type_wpt);
+#else
objid = mmo_write_obj_head("CObjWaypoint",
(wpt->shortname && *wpt->shortname) ? CSTRc(wpt->shortname) : "Mark", time, obj_type_wpt);
+#endif
data = mmo_register_object(objid, wpt, wptdata);
data->refct = 1;
mmo_write_category("CCategory", (mmo_datatype == rtedata) ? "Waypoints" : "Marks");
tmp.is_html = 1;
cx = kml = strip_html(&tmp);
}
- str = xstrappend(str, cx);
+ str = xstrappend(str, CSTRc(cx));
if (kml) {
xfree(kml);
}
if (time == 0x7FFFFFFF) {
time = gpsbabel_time;
}
-
+#if NEW_STRINGS
+ objid = mmo_write_obj_head("CObjRoute",
+ rte->rte_name.isEmpty() ? "Route" : CSTRc(rte->rte_name), time, obj_type_rte);
+#else
objid = mmo_write_obj_head("CObjRoute",
(rte->rte_name && *rte->rte_name) ? CSTRc(rte->rte_name) : "Route", time, obj_type_rte);
+#endif
mmo_register_object(objid, rte, rtedata);
mmo_write_category("CCategory", "Route");
gbfputc(0, fout); /* unknown */
if (trk->rte_waypt_ct <= 0) {
return;
}
-
+#if NEW_STRINGS
+ objid = mmo_write_obj_head("CObjTrack",
+ trk->rte_name.isEmpty() ? "Track" : CSTRc(trk->rte_name), gpsbabel_time, obj_type_trk);
+#else
objid = mmo_write_obj_head("CObjTrack",
(trk->rte_name && *trk->rte_name) ? CSTRc(trk->rte_name) : "Track", gpsbabel_time, obj_type_trk);
+#endif
mmo_write_category("CCategory", "Track");
gbfputuint16(trk->rte_waypt_ct, fout);